package com.example.demo.Service;

import com.example.demo.Entity.Article;
import com.example.demo.Entity.ArticleVo;

import com.example.demo.mapper.ArticleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {
   @Autowired
    public ArticleMapper articleMapper;
   public  int add(Article article){
       return articleMapper.add(article);
   }
   public Article getDetailById(Integer id,Integer uid){
       return  articleMapper.getDetailById(id,uid);
   }
   public int update(Article article){
       return articleMapper.update(article);
   }
   public ArticleVo getDetail(Integer id){
       return articleMapper.getDetail(id);
   }
   public int addRcount(Integer id){
       return articleMapper.addRcount(id);
   }
   public List<Article> getMyArtList(Integer id){
       return  articleMapper.getMyArtList(id);
   }
   public  int countArt(Integer uid){
       return  articleMapper.countArt(uid);
   }
   public  int delById(Integer id,Integer uid){
       return articleMapper.delById(id,uid);
   }
   public List<Article> pageLimt(Integer pageSize,Integer offset){
       return articleMapper.pageLimt(pageSize,offset);
   }
   public  int sumArt(){
       return articleMapper.sumArt();
   }
}
